package com.moore.service.impl;

import com.moore.bean.Candidate;
import com.moore.dto.ResponseData;
import com.moore.mapper.RegisterMapper;
import com.moore.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RegisterServiceImpl implements RegisterService {
    @Autowired
    private RegisterMapper registerMapper;

    @Override
    public ResponseData register(Candidate candidate) {
        int result = registerMapper.insert(candidate);
        if (result > 0){
            return ResponseData.ok("注册成功");
        } else {
            return ResponseData.error("注册失败");
        }
    }
}
